package com.csesteel.crm.service;

import com.csesteel.crm.domain.CrmPriviledge;

import java.util.List;

/**
 * Created by Administrator on 2015/5/20 0020.
 */
public interface CrmPriviledgeService {
    /**
     * 根据id 获取权限
     * @param id
     * @return
     */
    CrmPriviledge getCrmPriviledge(Integer id);

    /**
     * 保存权限
     * @param crmPriviledge
     */
    void saveCrmPriviledge(CrmPriviledge crmPriviledge);

    /**
     * 修改权限
     * @param crmPriviledge
     */
    void updateCrmPriviledge(CrmPriviledge crmPriviledge);
    /**
     * 删除权限
     * @param id
     */
    void deleteCrmPriviledge(Integer id);

    /**
     * 查询所有权限
     * @return
     */
    List<CrmPriviledge> findAllCrmPriviledge();

    /**
     * 查询所有权限
     * @return
     */
    List<CrmPriviledge> findAllCrmPriviledgeByPage(int pageNo, int pageSize, String name);

    /**
     * 查询所有总数
     * @return
     */
    long findCount(String name);
    /**
     * 根据用户ID查询角色
     * @param id
     * @return
     */
//    List<CrmPriviledge> findAllUserByUserId(Integer id);

    /**
     * 保存权限对应菜单资源
     * @param priviledgeId
     * @param menuId
     */
    public void savePriviledgeByMenu(Integer priviledgeId, Integer menuId);

    /**
     * 根据权限id删除关联的菜单
     * @param priviledgeId
     */
    public void deletePriviledgeByMenu(Integer priviledgeId);
}
